<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>同步异步先后执行顺序</title>
</head>
<body>
<script>
    // 同步和异步同时出现 --- 先执行同步在执行异步任务


    async function fun() {
        console.log('000')

        let result1= new Promise((resolve, reject) => {
            console.log('111')
            resolve('ok')
        })
        console.log('222')
        await result1.then(value => {
            console.log(value)
        })

        console.log('333')
        console.log('444')
    }
    fun()
     console.log('555')
</script>
</body>
</html>